package org.hydrakyoufeng.stuplatform.service;

import jakarta.servlet.http.HttpServletRequest;
import org.hydrakyoufeng.stuplatform.dto.AdminLoginDTO;
import org.hydrakyoufeng.stuplatform.dto.UserDTO;
import org.hydrakyoufeng.stuplatform.dto.UserLoginDTO;
import org.hydrakyoufeng.stuplatform.utils.ResultEntity;

public interface LoginService {

    ResultEntity adminLogin(AdminLoginDTO adminLoginDto, HttpServletRequest request) throws Exception;

    /**
     * 用于用户注册
     * @param userDTO
     * @return
     * @throws Exception
     */
    ResultEntity userLogon(UserDTO userDTO) throws Exception;

    /**
     * 根据电话号码查询用户数量
     * @param mobile
     * @return
     */
    ResultEntity queryUserCount(String mobile);

    /**
     * 获取登录图形验证码，以base64的加密字符串方式返回图片
     */
    ResultEntity verificationCode() throws Exception;


    /**
     * 使用密码进行登录
     * @param userLoginDTO
     * @return
     */
    ResultEntity userLoginByPassword(UserLoginDTO userLoginDTO,HttpServletRequest request) throws Exception;

    /**
     * 发送手机验证码
     * @param userLoginDTO
     * @return
     */
    ResultEntity sendMsgCode(UserLoginDTO userLoginDTO) throws Exception;

    /**
     * 使用验证码登录
     * @param userLoginDTO
     * @param request
     * @return
     * @throws Exception
     */
    ResultEntity userLoginByCode(UserLoginDTO userLoginDTO, HttpServletRequest request) throws Exception;

    /**
     * 前端用户退出登录
     * @param request
     * @return
     */
    ResultEntity userLogout(HttpServletRequest request);
}
